package cn.wbu.zyh.controller.user;

import cn.wbu.zyh.dto.AnnotationPageQueryDTO;
import cn.wbu.zyh.dto.ArticlePageQueryDTO;
import cn.wbu.zyh.result.PageResult;
import cn.wbu.zyh.result.Result;
import cn.wbu.zyh.service.AnnotationService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/annotations")
@Slf4j
public class AnnotationController {
    @Autowired
    private AnnotationService annotationService;

    @PostMapping("/list")
    public Result<PageResult> pageQueryByNoteId(@RequestBody AnnotationPageQueryDTO annotationPageQueryDTO) {
        log.info("批注分页查询, 参数为: {}", annotationPageQueryDTO);
        PageResult pageResult = annotationService.pageQueryByNoteId(annotationPageQueryDTO);
        return Result.success(pageResult);
    }
}
